package pl.com.sthaether.mc.config;

public class MCMainConfiguration {

    // Engine
    public static final int THREAD_COUNT = 4;
    public static final long MAX_SCALE_DIVIDER = 50000000;
    public static final long MIN_SCALE_DIVIDER = 5000;
    public static final long MIN_MAP_EDGE_SIZE = 1000;//meters


    // Main Frame
    private static int applicationWidth = 800;
    private static int applicationHeight = 600;
    private static boolean fullScreen = false;

    // Workspace
    private static String workPath = "";
    private static String lastOpenPath = "";
    private static boolean autoLoadLast = false;

    // Map - scale 1:scaleValue , sizes (width,height) in meters, not scalable
    private static long defaultScale = 1000L;
    private static long defaultMapWidth = 2000L;
    private static long defaultMapHeight = 2000L;

    public static void initConfiguration() {
        // TODO - init data from file - if no file leave default/empty
    }

    public static long getDefaultMapWidth() {
        return defaultMapWidth;
    }

    public static void setDefaultMapWidth(long defaultMapWidth) {
        MCMainConfiguration.defaultMapWidth = defaultMapWidth;
    }

    public static long getDefaultMapHeight() {
        return defaultMapHeight;
    }

    public static void setDefaultMapHeight(long defaultMapHeight) {
        MCMainConfiguration.defaultMapHeight = defaultMapHeight;
    }

    public static long getDefaultScale() {
        return defaultScale;
    }

    public static void setDefaultScale(long defaultScale) {
        MCMainConfiguration.defaultScale = defaultScale;
    }

    public static int getApplicationWidth() {
        return applicationWidth;
    }

    public static void setApplicationWidth(int applicationWidth) {
        if (applicationWidth > 0)
            MCMainConfiguration.applicationWidth = applicationWidth;
    }

    public static int getApplicationHeight() {
        return applicationHeight;
    }

    public static void setApplicationHeight(int applicationHeight) {
        if (applicationHeight > 0)
            MCMainConfiguration.applicationHeight = applicationHeight;
    }

    public static boolean isFullScreen() {
        return fullScreen;
    }

    public static void setFullScreen(boolean fullScreen) {
        MCMainConfiguration.fullScreen = fullScreen;
    }

    public static String getWorkPath() {
        return workPath;
    }

    public static void setWorkPath(String workPath) {// TOOD add validation
        MCMainConfiguration.workPath = workPath;
    }

    public static String getLastOpenPath() {
        return lastOpenPath;
    }

    public static void setLastOpenPath(String lastOpenPath) {
        MCMainConfiguration.lastOpenPath = lastOpenPath;
    }

    public static boolean isAutoLoadLast() {
        return autoLoadLast;
    }

    public static void setAutoLoadLast(boolean autoLoadLast) {
        MCMainConfiguration.autoLoadLast = autoLoadLast;
    }

}
